import Vue from 'vue'
import VueRouter from 'vue-router'
// import { component } from 'vue/types/umd'
// import { component } from 'vue/types/umd'

Vue.use(VueRouter)

const routes = [
  // {
  //   // 重定向
  //   path: '/',
  //   redirect: '/login'
  // },
  {

    path: '/',
    component: () => import('@/views/layout/index'),
    children: [
      {
        path: '/',
        component: () => import('@/views/home')
      },
      {
        path: '/video',
        component: () => import('@/views/video')
      },
      {
        path: '/qa',
        component: () => import('@/views/qa')
      },
      {
        path: '/my',
        component: () => import('@/views/profile')
      }

    ]
  },
  {

    path: '/login',
    component: () => import('@/views/login')
  }

]

const router = new VueRouter({
  routes
})

export default router
